<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>绿色企业账号注册页面</title>
    <link rel="stylesheet" href="login.css">
</head>
<body>
    <main>
        <form class="form-register" action="">

            <!--边框-->
            <div class="form__cover"></div>
            <div class="form__loader">
                <div class="spinner active">
                    <!--转圈-->
                    <svg class="spinner__circular" viewBox="25 25 50 50">
                        <circle class="spinner__path" cx="50" cy="50" r="20" fill="none" stroke-width="4" stroke-miterlimit="10"></circle>
                    </svg>
                </div>
            </div>

            <div class="form__content">
                <h1>企业账号注册</h1>
                <div class="styled-input">
                    <input type="text" class="styled-input__input" name="nickname" id="name">
                    <div class="styled-input__placeholder">
                        <span for="name" class="styled-input__placeholder-text" >请输入企业名</span>
                    </div>
                    <div class="styled-input__circle"></div>
                </div>
                <div class="styled-input">
                    <input type="text" class="styled-input__input" name="nickname" id="coding">
                    <div class="styled-input__placeholder">
                        <span for="coding" class="styled-input__placeholder-text" >请输入企业编码</span>
                    </div>
                    <div class="styled-input__circle"></div>
                </div>
                <div class="styled-input">
                    <input type="text" class="styled-input__input" name="nickname" id="address">
                    <div class="styled-input__placeholder">
                        <span for="address" class="styled-input__placeholder-text" >请输入企业地址</span>
                    </div>
                    <div class="styled-input__circle"></div>
                </div>
                <div class="styled-input">
                    <input type="text" class="styled-input__input" name="nickname" id="phonenumber">
                    <div class="styled-input__placeholder">
                        <span for="phonenumber" class="styled-input__placeholder-text" >请输入企业联系号码</span>
                    </div>
                    <div class="styled-input__circle"></div>
                </div>
                <div class="styled-input">
                     <input type="password" class="styled-input__input" id="password">
                    <div class="styled-input__placeholder">
                        <span for="password" class="styled-input__placeholder-text">请输入登录密码</span>
                    </div>
                    <div class="styled-input__circle"></div>
                </div>
                <button type="button" class="styled-button" id="register-button">
                    <span class="styled-button__real-text-holder">
                        <span class="styled-button__real-text">立即注册</span>
                        <span class="styled-button__moving-block face">
                            <span class="styled-button__text-holder">
                                <span class="styled-button__text">立即注册</span>
                            </span>
                        </span><span class="styled-button__moving-block back">
                            <span class="styled-button__text-holder">
                                <span class="styled-button__text">立即注册</span>
                            </span>
                        </span>
                    </span>
                </button>

            </div>
        </form>
    </main>

<script  src="login.js"></script>
<script src="../qrcode/jquery2.1.4.js"></script>
<script src="../layer/layer.js"></script>
<script>
    $(function () {
        $("#register-button").click(function(){
            var name = $("#name").val();
            var coding = $("#coding").val();
            var address=$("#address").val();
            var phonenumber=$("#phonenumber").val();
            var password=$("#password").val();

            //1 先转圈
            var windowId=layer.load(0);

            //2 ajax与服务器交互
            $.post("/test/admin/register.do",
                {   name:name,//企业名
                    coding:coding,//企业编码
                    phonenumber:phonenumber,//企业电话号码
                    address:address,//企业地址
                    password:password},//密码
                function (data) {

                //3 关闭load窗口
                layer.close(windowId);

                //4 讲服务器返回结果进行显示
                layer.msg(data.result);


            },"JSON");


        });
    });
</script>
</body>
</html>
